package cn.gbase.jiangsu.data.transfer.bean;

import java.util.Date;
import java.util.List;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Readonly;
import org.nutz.dao.entity.annotation.Table;
import org.nutz.dao.entity.annotation.View;

import cn.gbase.jiangsu.data.transfer.validation.annotation.Validations;

/**
 * 商品分类树的节点.
 * 
 */
@Table("product_sort_tree_node")
@View("product_sort_tree_node_view")
public class ProductSortTreeNode extends BaseDto {

	/**
	 * ID.
	 */
	@Column
	@Id
	private int id;

	/**
	 * 分类名称.
	 */
	@Column
	@Validations(required = true, strLen = { 1, 50 }, errorMsg = "分类名称应为1-50个字符。")
	private String name;

	/**
	 * 编码.
	 */
	@Column
	@Validations(required = true, strLen = { 1, 50 }, errorMsg = "分类编码名称应为1-50个字符。")
	private String code;

	/**
	 * 父ID.
	 */
	@Column
	private int pid;

	/**
	 * 父节点的名称.
	 */
	@Column
	@Readonly
	private String pName;

	/**
	 * 树Id.
	 */
	@Column
	private int treeId;

	/**
	 * leftId
	 */
	@Column
	private int leftId;

	/**
	 * rightId
	 */
	@Column
	private int rightId;

	/**
	 * 分类所在层次级别
	 */
	@Column
	private int level;

	/**
	 * 带级别的名称.
	 */
	@Column
	@Readonly
	private String levelName;

	/**
	 * 创建时间.
	 */
	@Column
	private Date addtime;

	/**
	 * 创建时间.
	 */
	@Column("create_user")
	private String createUser;

	/**
	 * 关联商品的数量.
	 */
	private int linkProductCount;

	/**
	 * 子节点的数量.
	 */
	@Column
	@Readonly
	private int childCount;

	/**
	 * 子节点的列表.
	 */
	private List<ProductSortTreeNode> childNodeList;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public int getPid() {
		return pid;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}

	public int getTreeId() {
		return treeId;
	}

	public void setTreeId(int treeId) {
		this.treeId = treeId;
	}

	public int getLeftId() {
		return leftId;
	}

	public void setLeftId(int leftId) {
		this.leftId = leftId;
	}

	public int getRightId() {
		return rightId;
	}

	public void setRightId(int rightId) {
		this.rightId = rightId;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public Date getAddtime() {
		return addtime;
	}

	public void setAddtime(Date addtime) {
		this.addtime = addtime;
	}

	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public String getLevelName() {
		return levelName;
	}

	public void setLevelName(String levelName) {
		this.levelName = levelName;
	}

	public int getLinkProductCount() {
		return linkProductCount;
	}

	public int getChildCount() {
		return childCount;
	}

	public String getpName() {
		return pName;
	}

	public void setpName(String pName) {
		this.pName = pName;
	}

	private int comunityId;

	public int getComunityId() {
		return comunityId;
	}

	public void setComunityId(int comunityId) {
		this.comunityId = comunityId;
	}

	public List<ProductSortTreeNode> getChildNodeList() {
		return childNodeList;
	}

	public void setChildNodeList(List<ProductSortTreeNode> childNodeList) {
		this.childNodeList = childNodeList;
	}

}
